# Maintainer: Jelle van der Waa <jelle@archlinux.org>
# Contributor: Kewl <xrjy@nygb.rh.bet(rot13)>
# Contributor: Andy Weidenbaum <archbaum@gmail.com>

pkgname=python-rstr
_pkgname=rstr
pkgver=3.2.1
pkgrel=1
pkgdesc="Generate random strings in Python"
arch=('any')
url="https://github.com/leapfrogonline/rstr"
license=('BSD')
depends=('python')
makedepends=(python-setuptools python-setuptools-scm python-build python-installer python-wheel)
source=("https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha256sums=('c51924c626540eb626ed3eb8e5e6c1d2f2c73959d039c8ff61ee562baeb4e0ff')

prepare() {
  cd $_pkgname-$pkgver
}

build() {
  cd $_pkgname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pkgname-$pkgver
  python3 -m unittest discover
}

package() {
  cd $_pkgname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
}
